<?php
namespace Baseapp\Models;
class MemberType extends \Phalcon\Mvc\Model
{

    public $id;

    public $group_name;

    public $is_del;

    public function initialize()
    {
        $this->hasMany("id", "Member", "type_id");
    }


    public static function getOptions()
    {
        $res = MemberType::find();
        $arr = array();
        foreach ($res as $type) {
            $arr[$type->id] = $type->type_name;
        }
        return $arr;
    }

    public static function getStrOptions()
    {
        $res = self::getOptions();
        $str = '';
        foreach ($res as $id => $typeName) {
            $str .= $id . ':' . $typeName . ';';
        }
        return rtrim($str, ';');
    }

}
